<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
<head>
    <title>Quartz 表达式</title>
    <meta charset="utf-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
    <meta name="description" content="overview &amp; stats"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0"/>
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
    <meta name="author" content="">
    <link rel="icon" href="../../favicon.ico">
    <!-- Bootstrap core CSS -->
    <link th:href="@{/assets/css/bootstrap.min.css}" rel="stylesheet">
    <!-- Custom styles for this template -->
    <link th:href="@{/assets/css/jumbotron.css}" rel="stylesheet">
    <!--[if lt IE 9]>
    <script th:src="@{/assets/js/html5shiv.min.js}"></script>
    <script th:src="@{/assets/js/respond.min.js}"></script>
    <![endif]-->
</head>

<body>

<nav class="navbar navbar-inverse navbar-fixed-top">
    <div class="container">
        <div class="navbar-header">
            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="#">Quartz 定时任务工具</a>
        </div>
        <div id="navbar" class="navbar-collapse collapse">
            <form class="navbar-form navbar-right">
                <div class="form-group">
                    <input placeholder="Email" class="form-control" type="text">
                </div>
                <div class="form-group">
                    <input placeholder="Password" class="form-control" type="password">
                </div>
                <button type="submit" class="btn btn-success">Sign in</button>
            </form>
        </div><!--/.navbar-collapse -->
    </div>
</nav>

<!-- Main jumbotron for a primary marketing message or call to action -->
<div class="jumbotron">
    <div class="container">
        <h1>Hello, Quartz!</h1>
        <p>Quartz是OpenSymphony开源组织在Job scheduling领域又一个开源项目，它可以与J2EE与J2SE应用程序相结合也可以单独使用。Quartz可以用来创建简单或为运行十个，百个，甚至是好几万个Jobs这样复杂的程序。Jobs可以做成标准的Java组件或 EJBs。Quartz的最新版本为Quartz 2.3.0。</p>
        <p><a class="btn btn-primary btn-lg" href="http://www.quartz-scheduler.org/" role="button" target="_blank">了解更多 »</a></p>
    </div>
</div>

<div class="container">
    <input type="hidden" id="urlIndex" th:value="@{/qutz/}" />
    <!-- Quartz Table List -->
    <div class="row">
        <div class="col-md-12">
            <div class="page-header"><h2>定时任务列表</h2></div>
            <div class="row">
                <div class="col-md-12">
                    <table class="table table-striped">
                        <thead>
                        <tr>
                            <th>#</th>
                            <th>任务名称</th>
                            <th>任务所在组</th>
                            <th>任务类名</th>
                            <th>触发器名称</th>
                            <th>触发器所在组</th>
                            <th>表达式</th>
                            <th>时区</th>
                            <th>操作
                                <!--
                                <button type="button" class="btn btn-xs btn-default">Default</button>
                                <button type="button" class="btn btn-xs btn-primary">Primary</button>
                                <button type="button" class="btn btn-xs btn-success">Success</button>
                                <button type="button" class="btn btn-xs btn-info">Info</button>
                                <button type="button" class="btn btn-xs btn-warning">Warning</button>
                                <button type="button" class="btn btn-xs btn-danger">Danger</button>
                                <button type="button" class="btn btn-xs btn-link">Link</button> -->
                            </th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr>
                            <td>2</td>
                            <td>Mark</td>
                            <td>Otto</td>
                            <td>@mdo</td>
                            <td>2</td>
                            <td>Jacob</td>
                            <td>Thornton</td>
                            <td>@fat</td>
                            <td>
                                <button type="button" onclick="postUrl(2,'jobName','jobGroup',1)" class="btn btn-xs btn-default">恢复</button>
                                <button type="button" onclick="postUrl(1,'jobName','jobGroup',4)" class="btn btn-xs btn-info">修改</button>
                                <button type="button" onclick="postUrl(3,'jobName','jobGroup',2)" class="btn btn-xs btn-warning">暂停</button>
                                <button type="button" onclick="postUrl(4,'jobName','jobGroup',3)" class="btn btn-xs btn-danger">删除</button>
                            </td>
                        </tr>
                        <tr>
                            <td>2</td>
                            <td>Mark</td>
                            <td>Otto</td>
                            <td>@mdo</td>
                            <td>2</td>
                            <td>Jacob</td>
                            <td>Thornton</td>
                            <td>@fat</td>
                            <td>
                                <button type="button" onclick="postUrl(2,'jobName','jobGroup',1)" class="btn btn-xs btn-default">恢复</button>
                                <button type="button" onclick="postUrl(1,'jobName','jobGroup',4)" class="btn btn-xs btn-info">修改</button>
                                <button type="button" onclick="postUrl(3,'jobName','jobGroup',2)" class="btn btn-xs btn-warning">暂停</button>
                                <button type="button" onclick="postUrl(4,'jobName','jobGroup',3)" class="btn btn-xs btn-danger">删除</button>
                            </td>
                        </tr>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
    <!-- Example row of columns -->
    <hr>
    <footer>
        <p>© 2016 Company, Inc.</p>
    </footer>
</div> <!-- /container -->
<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script th:src="@{/assets/js/jquery.min.js}"></script>
<script th:src="@{/assets/js/bootstrap.min.js}"></script>
<script th:src="@{/assets/plug/layer/layer.js}"></script>
<script language="JavaScript" type="application/javascript">
    var urlIndex = "";
    function postUrl(objId,jobName,jobGroup,flg) {
        switch (flg) {
            case 1:
                urlIndex = $("#urlIndex").val() + "resumeJob";
                break
            case 2:
                urlIndex = $("#urlIndex").val() + "pauseJob";
                break
            case 3:
                urlIndex = $("#urlIndex").val() + "deleteJob";
                break
            case 4:
                urlIndex = $("#urlIndex").val() + "initQuartzPageView";
                break
        }
        var data = new Object();
        data.jobName = "";
        data.jobGroup = "";
        $.ajax({
            url: urlIndex,
            type: "POST",
            data: data,
            dataType: "jsonp",  //指定服务器返回的数据类型
            jsonp: "callback",   //指定参数名称
            jsonpCallback: "reloadPage",  //指定回调函数名称
            success: function (data) {
                var datas = eval(data);
                layer.msg("返回编码：" + datas.code + "，系统消息：" + datas.msg);
                console.info("调用success");
            }
        });
    }
</script>
</body></html>